//# sourceURL=http://uMapApp/Module/PQI/DataPanelBlock
define([
    "mhjs/mhjs"
], function (
    mhjs
) {

    function DataPanelBlock(option) {

        var _this = this;

        _this.ui = _this.ui || {};
        _this.ui.label = new mhjs.Div({"class" : "label"});
        _this.ui.data = new mhjs.Div({"class" : "data countOnly"});
        _this.ui.data.count = new mhjs.Div({"class" : "count"});
        _this.ui.data.unit = new mhjs.Div({"class" : "unit"});

        mhjs.Div.call(_this, option);
        _this.addClass("dataPanelBlock");

        _this.ui.data
            .append(_this.ui.data.count)
            .append(_this.ui.data.unit)
        ;

        _this
            .append(_this.ui.data)
            .append(_this.ui.label)
        ;

    }

    var _class = DataPanelBlock;
    mhjs.Inherit(_class, mhjs.Div);


    Object.defineProperties(_class.prototype, {
        "label" : {
            set : function (label) {
                var _this = this;
                _this._label = label;
                _this.ui.label.text(label);
            },
            get : function () {
                return this._label;
            }
        },
        "count" : {
            set : function (count) {
                var _this = this;
                _this._count = count;
                _this.ui.data.count.text(count);
            },
            get : function () {
                return this._count;
            }
        },
        "unit"  : {
            set : function (unit) {
                var _this = this;
                _this._unit = unit;
                _this.ui.data.unit.text(unit);

                if (unit !== undefined) {
                    _this.ui.data.removeClass("countOnly");
                } else {
                    _this.ui.data.addClass("countOnly");
                }

            },
            get : function () {
                return this._unit;
            }
        }
    });

    return _class;

});